<?php
class AjaxController extends Controller
{
	public function actionThongKePhanCong()
	{
		if(Yii::app()->request->isAjaxRequest)
		{
			$model=new AjaxThongKe();	
			$model->thongKePc();	
			$this->renderPartial('thongke_danhan',array('model'=>$model));
		}
	}
	
	public function actionCongViecDaTao()
	{
		if(Yii::app()->request->isAjaxRequest)
		{
			$model=new AjaxThongKe();
			$model->thongKeCvDaTao();
			$this->renderPartial('thongke_dagui',array('model'=>$model));
		}
	}
	
	public function actionLoadTreeCv()
	{
		if(Yii::app()->request->isAjaxRequest)
		{
			if(isset($_POST['id']))
			{	
				$treecv=CongViec::model()->getTreeCb($_POST['id']);
				echo CJavaScript::jsonEncode($treecv);
			}
		}
		
	}
	
	public function actionLoadTreeChuyenCv()
	{
		if(Yii::app()->request->isAjaxRequest)
		{
			if(isset($_POST['id']))
			{
				$tree=CongViec::model()->getTreeCv($_POST['id']);
				echo CJavaScript::jsonEncode($tree);
			}
		}
	
	}
}